﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="cartdetail.aspx.cs" Inherits="KTSonline.ajax.cartdetail" %>

<table cellpadding="5" cellspacing="0" id="tblCart">
    <tbody>
        <tr class="cartHeader">
            <th>STT</th>
            <th>Tên sản phẩm</th>
            <th>Loại sản phẩm</th>
            <th>Đơn giá</th>
            <th>SL</th>
            <th>Thành tiền</th>
            <th></th>
        </tr>
        <asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>
                <tr class="row">
                    <td class="cen"><%#(((RepeaterItem)Container).ItemIndex + 1).ToString() %></td>
                    <td><%# Eval("name") %></td>
                    <td><%# Eval("category") %></td>
                    <td class="right"><%# Eval("price", "{0:N0}") %></td>
                    <td class="cen"><input type="text" id="cartqty<%#Eval("id") %>" value="<%# Eval("quantity", "{0:N0}")%>" maxlength="3" size="2" onkeyup="updateQTY(this)" /></td>
                    <td class="right"><%# getTotal(Eval("quantity"), Eval("price"))%></td>
                    <td><a href="JavaScript:CartFunc('<%#Eval("id") %>', 5)">Delete</a></td>
                </tr> 
            </ItemTemplate>
            <AlternatingItemTemplate>
                <tr class="altrow">
                    <td class="cen"><%#(((RepeaterItem)Container).ItemIndex + 1).ToString() %></td>
                    <td><%# Eval("name") %></td>
                    <td><%# Eval("category") %></td>
                    <td class="right"><%# Eval("price", "{0:N0}")%></td>
                    <td class="cen"><input type="text" id="cartqty<%#Eval("id") %>" value="<%# Eval("quantity", "{0:N0}")%>" maxlength="3" size="2" onkeyup="updateQTY(this)" /></td>
                    <td class="right"><%# getTotal(Eval("quantity"), Eval("price")) %></td>
                    <td><a href="JavaScript:CartFunc('<%#Eval("id") %>', 5)">Delete</a></td>
                </tr>
            </AlternatingItemTemplate>
        </asp:Repeater>
        <tr class="cartFooter">
            <th colspan="4" class="right">Tổng cộng</th>
            <th class="cen"><%= cart.quantity.ToString("N0") %></th>
            <th class="right"><%= cart.totalprice.ToString("N0")%></th>
            <th colspan="2"></th>
        </tr>
    </tbody>
</table>